/**
 * @version 3 11 February 2013
 * @author Myhaylo Kotsyuruba
 */

public class Estimator {
    private AnswerMap[] correctAnswers;

    public void setCorrectAnswers(AnswerMap[] correctAnswers) {
        this.correctAnswers = correctAnswers;
    }
    
    public void evaluate(AnswerMap[] userAnswers) {
        for (int index = 0; index < correctAnswers.length; index++) {
            int quantityCommonElements = correctAnswers[index]
                    .getQuantityCommonElements(userAnswers[index]);
            int sizeMap = correctAnswers[index].getSize();
            int userScore = correctAnswers[index].getScore() 
                    * quantityCommonElements / sizeMap;
            userAnswers[index].setScore(userScore);
        }
    }
}



